﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using Abp.Dependency;
using Abp.PlugIns;
using Castle.Core.Internal;
using Microsoft.AspNetCore.Hosting;
using Microsoft.EntityFrameworkCore;
using KelonProud.Domain;

namespace KelonProud.Extensions
{
    public static class ModelBuilderExtension
    {
        public static void OnExpandDbContext(this ModelBuilder modelBuilder)
        {
            var dbContexts = IocManager.Instance.ResolveAll<IDbContextExtension>();

            dbContexts.Each(e=>e.RegistDomain(modelBuilder));
        }
    }
}
